package model

type SessionType int

const (
	SESSION_TYPE_PUSHER SessionType = iota
	SESSEION_TYPE_PLAYER
)

type TransType int

const UDP_BUF_SIZE = 1048576

const (
	TRANS_TYPE_TCP TransType = iota
	TRANS_TYPE_UDP
)

func (session *RTSP) Stop() {
	if session.Conn != nil {
		session.connRW.Flush()
		session.Conn.Close()
		session.Conn = nil
	}
	if session.UDPClient != nil {
		session.UDPClient.Stop()
		session.UDPClient = nil
	}
	if session.UDPServer != nil {
		session.UDPServer.Stop()
		session.UDPServer = nil
	}
	if session.Running() {
		session.Cancel()
	}
	if session.Stream != nil {
		collection.Delete(session.StreamPath)
	}
}
